<template>
  <slot :isDark="isDark()" :switchMode="appStore.switchMode"></slot>
</template>

<script lang="ts">
export default {
  name: 'UseDark'
}
</script>

<script lang="ts" setup>
import { storeToRefs } from 'pinia'
import { useDarkStore } from './store'
import { ThemeEnum } from './enums'

const { themeMode } = storeToRefs(useDarkStore())

const appStore = useDarkStore()

const isDark = () => {
  return themeMode.value === ThemeEnum.DARK
}
</script>
